var char = 'a';
(function() {
  console.log(char, 'char');
  if (typeof char ==  'undefined') {
    var char = 'b';
    console.log(char);
  } else {
    console.log(char)
  }
})();